import java.sql.Connection;
import java.sql.SQLException;

public class TestDB {
    public static void main(String[] args) {
        try {
            // 使用DBUtil获取连接
            Connection conn = DBUtil.getConnection();
            System.out.println("数据库连接成功！");
            conn.close();
        } catch (SQLException e) {
            System.err.println("连接失败: " + e.getMessage());
        }
    }
}